﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DomainModel;

[assembly: System.CLSCompliant(true)]
namespace MusicManager.BL
{
    public class ApplicatonException : Exception { }
    public class DuplicateMusicException : ApplicatonException { }
    public class UserAlreadyExistsException : ApplicationException { }

    public interface IMusicManagerBL
    {
        bool CreateUser(int id, string user, string password);
        /// <summary>
        /// Login with username and pw. returns Token for auth. 
        /// </summary>
        /// <param name="user"></param>
        /// <param name="password"></param>
        /// <param name="token">token used vor authentification</param>
        /// <returns></returns>
        bool Login(string user, string password, out String token);
        bool Logout(string user, String token);
        IEnumerable<User> GetUserList();
        IEnumerable<User> GetUserByNameLike(string namepart);

        bool AddMusic(string name, byte[] data, String token);
        IEnumerable<string> GetPlaylist(String token);
        IEnumerable<Music> GetPlaylistFull(String token);
        Music GetMusic(string name, String token);
    }
}
